#include "Node.h"

//-------------------------------------------------------------------------------------------
Node::Node(float x, float y)
{
	m_x = x;
	m_y = y;
}

//-------------------------------------------------------------------------------------------
Node::~Node()
{
}

//-------------------------------------------------------------------------------------------
void Node::SetID(int ID)
{
	m_ID = ID;
}

//-------------------------------------------------------------------------------------------
int Node::GetID()
{
	return m_ID;
}

//-------------------------------------------------------------------------------------------
float Node::GetY()
{
	return m_y;
}

//-------------------------------------------------------------------------------------------
float Node::GetX()
{
	return m_x;
}

//-------------------------------------------------------------------------------------------
int Node::GetConnection(Direction dir)
{
	if (m_connectedNodes.find(dir) == m_connectedNodes.end())
		return -1;

	return m_connectedNodes[dir];
}

//-------------------------------------------------------------------------------------------
bool Node::AddConnection(int NodeID, Direction dir)
{
	if (m_connectedNodes.find(dir) != m_connectedNodes.end())
		return false;

	m_connectedNodes[dir] = NodeID;
	return true;
}

//-------------------------------------------------------------------------------------------